package net.oschina.app.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import net.oschina.app.MApp;
import net.oschina.app.R;

import java.util.List;

/**
 * Created by Administrator on 2017/4/2.
 */

public class AttentionAdapter extends FragmentStatePagerAdapter {
    private List<Fragment> fragments;
    private List<String> titles;
    public AttentionAdapter(FragmentManager fm, List<Fragment>list) {
        super(fm);
//        this.fragments=fragments;
        this.fragments = list;
//        this.titles=titles;
//        String[] titles = MApp.mContext.getResources().getStringArray(R.array.friends_viewpage_arrays);

    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }


    //
    @Override
    public CharSequence getPageTitle(int position) {
        return MApp.mContext.getResources().getStringArray(R.array.friends_viewpage_arrays)[position];
    }


}
